package demo08;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import java.sql.Connection;

public class Demo {
    public static void main(String[] args) throws Exception{
        AnnotationConfigApplicationContext context =
                new AnnotationConfigApplicationContext(Config.class);
        Person person = context.getBean(Person.class);
        System.out.println(person);
        Student s = context.getBean(Student.class);
        System.out.println(s);


        DBUtil dbutil = context.getBean(DBUtil.class);
        System.out.println(dbutil);
        Connection connection = dbutil.getConnection();
        System.out.println(connection);


    }
}
